﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Schedule
{
    public partial class CheckInfoForm : Form
    {
        private DDLManage ddlManage;
        private string courseID;
        public CheckInfoForm(string courseID,string courseName)
        {

            this.courseID = courseID;
            InitializeComponent();
            this.label1.Text += courseID;
            this.label2.Text += courseName;

            ddlManage = new DDLManage(courseID);
            dataGridView1.DataSource = ddlManage.DDLDataTable;
            
           

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void deleteDDLBtn_Click(object sender, EventArgs e)
        {
            string DDLName = (string)ddlManage.DDLDataTable.Rows[dataGridView1.CurrentCell.RowIndex][0];//从ddl数据表中取出ddl名称
            ddlManage.deleteDDL(courseID, DDLName);
        }
    }
}
